stuff = function() {
  casedata <- read.csv("EssexCD_DAlungcancer_1999-2003.csv", header = TRUE)
  library(maptools)
  popdata <-  readShapePoly(fn="EssexCD_2001DApopcov/EssexCD_2001DApopcov")

result <- getRates(casedata, popdata, cancer~factor(age)*factor(sex), family=poisson)
newdata <- result[[2]]

#formula <- cancer~factor(age)*factor(sex)
#family=poisson
#data=newdata


#model <- glm(cancer ~ offset(logpop) + factor(age)*factor(sex), family=poisson, newdata)

#e.g. 
getExpObsSMR(glm(cancer ~ offset(logpop)+factor(age)*factor(sex), data=newdata), newdata)

}
